<script lang="ts" setup>
import type {BbsCodeNode} from "../../network/types/BbsCodeNode.ts";
import {ref, watch} from "vue";

interface Props {
  node: BbsCodeNode
}

const props = defineProps<Props>()

const show = ref<boolean>(false)

watch(props.node, (_) => show.value = false)
</script>

<template>
  <div class="nga-collapse">
    <el-switch v-model="show" :active-text="props.node.params || '折叠'"/>
    <div v-if="show">
      <slot></slot>
    </div>
  </div>
</template>

<style scoped>

</style>